<!--
* @description 物品详情
* @fileName dataDetail.vue
* @author huangyu
* @date 2022/05/19 15:49:15
!-->
<template>
    <div style="line-height:28px;margin-top:-20px;">
        <!-- {{id}} -->
        <!-- {{ strongModel }} -->
        <h3 v-if="model.pingzhi == '英雄'" class="color_yx">{{ model.name }} {{ strong ? '+' + strong : '' }}</h3>
        <h3 v-if="model.pingzhi == '唯一'" class="color_wy">{{ model.name }} {{ strong ? '+' + strong : '' }}</h3>
        <el-row style="height:120px;">
            <el-col :span="24">类型：{{ model.type }}</el-col>
            <el-col :span="24">品质：<span :class="model.pingzhi == '英雄' ? 'color_yx' : 'color_wy'">{{
                    model.pingzhi
            }}</span></el-col>
            <el-col :span="24">使用等级：{{ model.level }}</el-col>
        </el-row>

        <!-- 武器属性 -->
        <!-- 基础属性 -->
        <div v-if="model.ZBType == 1">
            <el-row v-if="wqBInfo.tList && wqBInfo.tList.length > 0" style="height:120px;">
                <el-col :span="12" v-for="(item, index) in wqBInfo.tList" :key="index">
                    {{ item }}：<span :class="model.pingzhi == '英雄' ? 'color_yx' : 'color_wy'">
                        {{ wqBInfo.list[index] }}
                        {{ strongModel && strongModel.wlgj && item == '伤害' ? '+' + strongModel.wlgj :
                                ''
                        }}
                        {{ strongModel && strongModel.mfzfl && item == '魔法增幅力' ? '+' +
                                strongModel.mfzfl : ''
                        }}
                    </span>
                </el-col>
            </el-row>
            <!-- 额外属性 -->
            <el-row v-if="wqEInfo.tList && wqEInfo.tList.length > 0" style="height:100px;">
                <el-col :span="12" v-for="(item, index) in wqEInfo.tList" :key="index">
                    {{ item }}：<span :class="model.pingzhi == '英雄' ? 'color_yx' : 'color_wy'">{{ wqEInfo.list[index]
                    }}</span>
                </el-col>
            </el-row>
        </div>

        <!-- 防具属性 -->
        <!-- 基础属性 -->
        <div v-if="model.ZBType == 2">
            <el-row v-if="fjBInfo.tList && fjBInfo.tList.length > 0" style="height:120px;">
                <el-col :span="12" v-for="(item, index) in fjBInfo.tList" :key="index">
                    {{ item }}：<span :class="model.pingzhi == '英雄' ? 'color_yx' : 'color_wy'">{{ fjBInfo.list[index]
                    }}</span>
                </el-col>
            </el-row>
            <!-- 额外属性 -->
            <el-row v-if="fjEInfo.tList && fjEInfo.tList.length" style="height:100px;">
                <el-col :span="12" v-for="(item, index) in fjEInfo.tList" :key="index">
                    {{ item }}：<span :class="model.pingzhi == '英雄' ? 'color_yx' : 'color_wy'">
                        {{ fjEInfo.list[index] }}
                        {{ strongModel && strongModel.hp && item == '生命上限' ? '+' + model.strongModel.hp : '' }}
                    </span>
                </el-col>
            </el-row>
        </div>

        <!-- 饰品属性 -->
        <!-- 基础属性 -->
        <div v-if="model.ZBType == 3">
            <el-row v-if="spBInfo.tList && spBInfo.tList.length > 0" style="height:120px;">
                <el-col :span="12" v-for="(item, index) in spBInfo.tList" :key="index">
                    {{ item }}：<span :class="model.pingzhi == '英雄' ? 'color_yx' : 'color_wy'">{{ spBInfo.list[index]
                    }}</span>
                </el-col>
            </el-row>
            <!-- 额外属性 -->
            <el-row v-if="spEInfo.tList && spEInfo.tList.length" style="height:100px;">
                <el-col :span="12" v-for="(item, index) in spEInfo.tList" :key="index">
                    {{ item }}：<span :class="model.pingzhi == '英雄' ? 'color_yx' : 'color_wy'">{{ spEInfo.list[index]
                    }}</span>
                </el-col>
            </el-row>
        </div>
        <!-- 魔石 -->
        <div v-if="msList">
            <el-row>
                <el-col :span="12" v-for="(item, index) in msList" :key="index" class="color_success">{{ item.name }} *
                    {{ item.number }}</el-col>
            </el-row>
        </div>
    </div>
</template>

<script>
// import { get } from '@/common/app.js'
// import {sxItemArr,sxItemArrT,bItemArrWQ,bItemArrTWQ,eItemArrWQ} from '@/components/game/aion/data.js'
import ZBInfo from "@/components/game/aion/data.js"
import { sxItemArr, sxItemArrT, WQbItemArr, WQbItemArrT, WQeItemArr, WQeItemArrT, FJbItemArr, FJbItemArrT, FJeItemArr, FJeItemArrT, SPbItemArr, SPbItemArrT, SPeItemArr, SPeItemArrT } from "@/components/game/aion/data.js"
export default {
    props: {
        model: {},
        strong: String,
        msList: [],
        strongModel: {},
    },
    components: {},
    data() {
        return {
            // model: {},
            ZBInfoS: ZBInfo,
            sxItemArrList: [],
            // model: { "_id": "fbf765c86285ad3f01792ef678892e57", "icon": "icon_item_staff_e01.jpg", "name": "塔哈巴塔之杖", "number": "101500605", "pingzhi": "英雄", "type": "法杖", "level": "50", "bhurt": "204~308", "bspeed": "2", "bhit": "920", "bwlzm": "60", "bwqfy": "820", "bmfzfl": "810", "bmfmz": "405", "egjsd": "+19%", "ewlmz": "+140", "ewlzm": "+63", "ewlgj": "+45", "ehp": "+317" },
            sxInfo: {},
            wqBInfo: {},
            wqEInfo: {},
            fjBInfo: {},
            fjEInfo: {},
            spBInfo: {},
            spEInfo: {},
        }
    },
    mounted() {
    },
    methods: {
        zbInfoData() {
            this.sxInfo = this.ZBInfoS.zbInfoFunction(this.model, sxItemArr, sxItemArrT)
            this.wqBInfo = this.ZBInfoS.zbInfoFunction(this.model, WQbItemArr, WQbItemArrT)
            this.wqEInfo = this.ZBInfoS.zbInfoFunction(this.model, WQeItemArr, WQeItemArrT)
            this.fjBInfo = this.ZBInfoS.zbInfoFunction(this.model, FJbItemArr, FJbItemArrT)
            this.fjEInfo = this.ZBInfoS.zbInfoFunction(this.model, FJeItemArr, FJeItemArrT)
            this.spBInfo = this.ZBInfoS.zbInfoFunction(this.model, SPbItemArr, SPbItemArrT)
            this.spEInfo = this.ZBInfoS.zbInfoFunction(this.model, SPeItemArr, SPeItemArrT)
        },
        // getData() {
        //     if (this.id) {
        //         let params = {
        //             type: 'getAionDetail',
        //             cType: this.ZBType,
        //             data: {
        //                 _id: this.id,
        //             },
        //         }
        //         get('game', params).then(res => {
        //             if (res.data) {
        //                 this.model = res.data[0]
        //                 // 方便后续操作，默认添加当前装备类型
        //                 this.model.ZBType = this.ZBType
        //                 this.zbInfoData()
        //             }
        //         })
        //     }
        // },
    },
    watch: {
        model: {
            handler: 'zbInfoData',
            immediate: true,
        },
    }
}
</script>

<style scoped>
</style>